1. Field of the Invention
The present invention relates to a method and an apparatus for compressing original data by coding thereof, and to a computer-readable recording medium storing a program for causing a computer to execute the data compression method.
2. Description of the Related Art
In the field of data compression such as image data compression by an image server in a medical network and compression of general data such as for communication and filing, various compression algorithms have been proposed. For example, as substantially efficient compression algorithms, the WTCQ method (P. Sriram and M. W. Marcellin, “Image coding using wavelet transforms and entropy-constrained trellis-coded quantization”, IEEE Transactions on Image Processing, vol. 4, pp. 725–733, June 1995) and the SPIHT method (A. Said and W. A. Pearlman, “A new Fast and Efficient Image Codec Based on Set Partitioning in Hierarchical Trees”, IEEE Transactions on Circuits and Systems for Video Tech., vol. 6. pp. 243–250, June 1996) have been proposed. FIG. 11 is a diagram explaining a compression algorithm according to the WTCQ method and the SPIHT method. Original image data S representing an original image are wavelet-transformed first. Data in each subband after the transform are classified while bit allocation is determined. Based on the determined bit allocation, quantization according to a TCQ method is carried out to obtain quantized data RS. Coded data are obtained by carrying out entropy coding on the quantized data RS. As the method for the entropy coding, in the WTCQ method, bit-plane binary arithmetic coding is used. In the bit-plane binary arithmetic coding, quantized data are decomposed into a plurality of bit planes, and converted into binary data. Binary arithmetic coding is carried out on the data in each bit plane and each output is coded. Meanwhile, in the SPIHT method, multi-valued arithmetic coding is used as the entropy coding. By compressing the original image data S in this manner, efficient coding with a substantially low bit rate can be carried out.
In the field of general JPEG compression, as shown in FIG. 12, an arithmetic coding method or a baseline method can be used. In the case of JPEG compression, discrete cosine transform (DCT) is carried out on the original image data S and quantization is carried out by determining bit allocation. In the case of arithmetic coding, after the quantized data RS have been converted from multi-valued data to binary data, binary arithmetic coding is carried out to obtain coded data. Meanwhile, in the case of the baseline method, the quantized data RS are coded using Huffman coding.
In the above-described SPIHT method, since multi-valued arithmetic coding is carried out, compression efficiency thereof is higher than that of the conventional Huffman coding or the like. However, computation therefor is time-consuming, since the multi-valued arithmetic coding is a substantially complex operation. Meanwhile, in the WTCQ method, since binary arithmetic coding is carried out, computation is carried out faster than in the SPIHT method. However, upon entropy coding, quantized data are decomposed into a plurality of bit planes (practically, approximately 14) and binary-coded, and it is necessary to carry out binary arithmetic coding thereafter on each bit plane. Therefore, as for the WTCQ method, a computational load becomes heavy as a whole, and the execution time is long.
In the arithmetic coding method in the above-described JPEG compression, data are binary coded as in the WTCQ method. Therefore, a computational load is heavy and the execution time is long. The baseline method uses Huffman coding, and the compression efficiency is thus lower than the WTCQ method or the like.